package com.likianta.anykey;

import android.util.Log;

/**
 * Created by Likianta_DoDoRa on 2017/11/30 0030.
 */

public class LogUtil {
    
    /**
     * 自制Log管理工具，通过设定level的等级，来显示自己想看的Log，而且只需要传入msg字段即可，tag统一为默认的“likianta_ddr”。
     * level设的越高，显示的信息就越危险。不过level设为NOTHING（=6）的时候，该Log工具将会关闭。因此在apk正式发布前，应把level调到NOTHING，从而把LogUtil关闭掉。
     */
    
    public static final int VERBOSE = 1;
    public static final int DEBUG = 2;
    public static final int INFO = 3;
    public static final int WARN = 4;
    public static final int ERROR = 5;
    public static final int NOTHING = 6;
    
    public static final String TAG = "likianta_ddr";
    
    public static int level = VERBOSE;
    
    public static void v(String msg){
        if (level <= VERBOSE){
            Log.d(TAG,msg);
        }
    }
    
    public static void d(String msg){
        if (level <= DEBUG){
            Log.d(TAG,msg);
        }
    }
    
    public static void i(String msg){
        if (level <= INFO){
            Log.d(TAG,msg);
        }
    }
    
    public static void w(String msg){
        if (level <= WARN){
            Log.d(TAG,msg);
        }
    }
    
    public static void e(String msg){
        if (level <= ERROR){
            Log.d(TAG,msg);
        }
    }
    
}
